<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script>
  (function (a, b) {
    var num = 2;
    console.log(a + b + num);
  })(3, 5);
  // => 10

  (function (c, d) {
    var num = 3;
    console.log(c + d + num);
  }(1, 1));
  // => 5
</script>
</body>
</html>